home *** CD-ROM | disk | FTP | other *** search
/ MacUser Ultimate Mac Companion / Mac User Ultimate Mac Companion 1996.bin / MacUser Archives / MACU1208 / 107WORLD.TXT < prev    next >
Encoding:
Text File  |  1996-08-01  |  7.9 KB  |  56 lines  |  [TEXT/ttxt]

  1. World Wide FileMaker
  2.  
  3. Add some interactive zing to your Web site by linking it to a FileMaker Pro database
  4.  
  5. Shelly Brisbin
  6.  
  7. Networking
  8.  
  9. Behind every searchable, fill-out-a-form-and-get-something-back Web site is a database -- but not necessarily a high-end, client/server database. In fact, if your Web site is running on a Mac-based Web server, you can link it to a Claris FileMaker Pro database with less trouble than you might think. Following is some guidance to lead you through the five main steps: planning what information you should share, finding a CGI (Common Gateway Interface) application, creating HTML forms, modifying your database, and tuning performance.
  10.  
  11. 1. Prepare to Share
  12.  
  13. To figure out which fields you should include in your database, first determine what information you want to acquire and share over the Web. Then decide if there's additional information you want to keep track of internally. Mocking up Web pages (and FileMaker layouts for the internal information) will help you with this process. As you plan, remember that it's hard to make repeating fields work with a CGI application; you're better off redesigning your database with a relational structure.
  14.  
  15. You also need to decide whether to let users add and update records. If, for example, you use FileMaker to create a guest book for your Web site, users will be adding records to the database. If you keep a sales database on the Web, allowing customers to order products and review their purchase history, you'll need to let them update some of the information in their records. Finally, if you're providing a product catalog, you may want users only to search for and sort records.
  16.  
  17. 2. Seek a CGI Application
  18.  
  19. To extend the capabilities of your Web server so it can talk to your database, you need a CGI application (see "Gateway to Web Success," July '96, page 97). You can also share a FileMaker database over the Internet without a CGI application; however, this is a slower, less secure method that requires all users to have the FileMaker Pro 3.0 application.
  20.  
  21. Commercial and freeware CGI applications that support FileMaker Pro are available on the Internet; all those currently available support record modification as well as searching. The two leading general-purpose CGI applications for FileMaker are WEB FM ($195), from Web Broadcasting (415-329-9676 or http://macweb.com/webfm/), and ROFM CGI (free), from Russell Owen (http://rowen.astro.washington.edu/). In addition, Claris (800-544-8554 or 408-727-8227; http://www.claris.com/filemaker/cgi.html) offers a free CGI application called Claris FileMaker CGI, which offers less sophisticated search capabilities; as with ROFM CGI, the source code for the Claris CGI application is free.
  22.  
  23. If you want to share documents rather than database contents over the Web, check out MacSite Searcher ($295), from Blue World Communications (206-313-1051; http://www.blueworld.com/).
  24.  
  25. Which CGI application you choose will depend partly on the FileMaker features you plan to use. CGI applications support specific operations such as sort, add/modify, and find. For MacUser's online database of reviews (http://www.zdnet.com/macuser/review .html), we used WEB FM, because it offers the most commands -- including variations of the Find command that allow users to find reviews of products meeting multiple conditions, such as "company name = Broderbund" and "category = children's software."
  26.  
  27. With your database plans in mind, check out each CGI application's Web site to see if the features you need are supported. Then try one or more out on your Web server (Web Broadcasting allows you to download a WEB FM demo, and the other two general-purpose products are freeware). Each package has documentation and sample databases.
  28.  
  29. 3. Fine-Tune Some Forms
  30.  
  31. CGI application packages are also a handy source for cribbing the next element of your FileMaker/Web connection: HTML forms. These are the Web pages that connect users to your database information. At the very least, you'll need a search page that contains a form for entering keywords and a button for submitting the request to your database. You'll also need to create or copy a search-results page that displays a listing of records the user's search retrieves. If you have made fields within each record available, a third page will let the user drill down to individual records. Your HTML form will not contain the actual contents of each database record or possible search result but rather a path that directs the CGI application's output to the page. Your search and results pages should include navigation aids (buttons and/or links) that can return users to the previous page or to help screens you've provided. All the CGI applications mentioned give examples of these basic types of pages, which you can modify in any HTML editor (for information on HTML authoring tools, see "The Web Author's Workshop," in this issue), and the tutorial on the Claris Web site offers an especially good section on HTML form tags.
  32.  
  33. 4. Fiddle with Fields
  34.  
  35. With HTML pages designed and linked to your home page, it's time to modify your database. CGI applications use FileMaker calculation fields to retrieve and deliver data to a user's Web browser. You need a new calculation field for each database operation you enable. The field contains HTML code the CGI application merges with the HTML forms you've designed. Each time the database is searched, the calculation field generates and passes on a new chunk of HTML to display the results of the search on the search-results page (see the "Instant Web Pages" sidebar).
  36.  
  37. The simplest database requires two new calculation fields. The first delivers a list of all records found to match a keyword search. The second calculation generates the HTML to display the contents of an individual record (for the specific item the user selects in the list generated by the first search). You need some knowledge of FileMaker calculations to create these fields, but CGI-application writers usually include a sample database.
  38.  
  39. In addition to calculation fields, you'll also need to give each database record a unique serial number, if it doesn't already have one. CGI applications use serial numbers to identify individual records in communicating with a database.
  40.  
  41. 5. Make It Speedy
  42.  
  43. With your calculation fields created, it's time to look at speed of database response. The attractive backgrounds and layouts you may have added to your database for print or on-screen presentation will only slow you down on the Web. Although graphic elements won't appear on the Web, their presence in a layout can slow the finding and sorting of database records. Switch your database to a text-only layout before loading it onto your Web server.
  44.  
  45. Next, you need to index each searchable field. Version 3.0 of FileMaker Pro does not automatically index fields, as previous versions of the program did. If you don't index them, your database searches will be unbearably slow. On the other hand, you should index only fields you intend to have users search, because indexing causes files to balloon rapidly, making them once again slow to sort.
  46.  
  47. Putting It All Together
  48.  
  49. Getting your FileMaker database onto the Web won't happen overnight. You'll need to spend some time with your CGI application's documentation as you follow the steps described here, and you'll want to test your database extensively before you put it on a "live" Web server. But once you're out there sharing a database with the world, you won't want to turn back.
  50.  
  51. MacUser Associate Editor Shell Brisbin opted not to put the database containing her CD collection on her Web site, although she was sorely tempted.
  52.  
  53. A new Web page is needed for database-search results, but where does the HTML code for such pages come from? In FileMaker Pro databases, calculation fields can generate the code for displaying data from a search-results page; the CGI application then merges this code with that for displaying a page's unchanging elements.
  54. Instant Web Pages / generating HTML to display searched-for data on the fly
  55.  
  56.